.class public Lcom/xingbook/park/a/u;
.super Landroid/widget/BaseAdapter;

# interfaces
.implements Landroid/view/View$OnClickListener;


# instance fields
.field a:Landroid/graphics/BitmapFactory$Options;

.field b:Lcom/xingbook/d/a;

.field c:[Lcn/a/a/c/a;

.field d:Z

.field private e:Landroid/content/Context;

.field private f:Lcom/xingbook/c/a;


# direct methods
.method public constructor <init>(Landroid/content/Context;[Lcn/a/a/c/a;)V
    .locals 3

    const/4 v2, 0x1

    invoke-direct {p0}, Landroid/widget/BaseAdapter;-><init>()V

    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/xingbook/park/a/u;->d:Z

    invoke-static {p1}, Lcom/xingbook/c/n;->a(Landroid/content/Context;)Lcom/xingbook/c/n;

    move-result-object v0

    invoke-virtual {v0}, Lcom/xingbook/c/n;->h()Lcom/xingbook/d/a;

    move-result-object v0

    iput-object v0, p0, Lcom/xingbook/park/a/u;->b:Lcom/xingbook/d/a;

    invoke-static {}, Lcom/xingbook/c/a;->a()Lcom/xingbook/c/a;

    move-result-object v0

    iput-object v0, p0, Lcom/xingbook/park/a/u;->f:Lcom/xingbook/c/a;

    iput-object p1, p0, Lcom/xingbook/park/a/u;->e:Landroid/content/Context;

    iput-object p2, p0, Lcom/xingbook/park/a/u;->c:[Lcn/a/a/c/a;

    new-instance v0, Landroid/graphics/BitmapFactory$Options;

    invoke-direct {v0}, Landroid/graphics/BitmapFactory$Options;-><init>()V

    iput-object v0, p0, Lcom/xingbook/park/a/u;->a:Landroid/graphics/BitmapFactory$Options;

    iget-object v0, p0, Lcom/xingbook/park/a/u;->a:Landroid/graphics/BitmapFactory$Options;

    sget-object v1, Landroid/graphics/Bitmap$Config;->RGB_565:Landroid/graphics/Bitmap$Config;

    iput-object v1, v0, Landroid/graphics/BitmapFactory$Options;->inPreferredConfig:Landroid/graphics/Bitmap$Config;

    iget-object v0, p0, Lcom/xingbook/park/a/u;->a:Landroid/graphics/BitmapFactory$Options;

    iput-boolean v2, v0, Landroid/graphics/BitmapFactory$Options;->inPurgeable:Z

    iget-object v0, p0, Lcom/xingbook/park/a/u;->a:Landroid/graphics/BitmapFactory$Options;

    iput-boolean v2, v0, Landroid/graphics/BitmapFactory$Options;->inInputShareable:Z

    iget-object v0, p0, Lcom/xingbook/park/a/u;->a:Landroid/graphics/BitmapFactory$Options;

    iput v2, v0, Landroid/graphics/BitmapFactory$Options;->inSampleSize:I

    return-void
.end method

.method private a(I)Landroid/graphics/Bitmap;
    .locals 5

    const/4 v2, 0x0

    :try_start_0
    new-instance v0, Ljava/lang/StringBuilder;

    iget-object v1, p0, Lcom/xingbook/park/a/u;->b:Lcom/xingbook/d/a;

    invoke-virtual {v1}, Lcom/xingbook/d/a;->s()Ljava/lang/String;

    move-result-object v1

    invoke-static {v1}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v1

    invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Lcom/xingbook/c/k;->b(Ljava/lang/String;)Landroid/graphics/Bitmap;
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    move-result-object v1

    if-nez v1, :cond_2

    :try_start_1
    iget-object v0, p0, Lcom/xingbook/park/a/u;->b:Lcom/xingbook/d/a;

    invoke-virtual {v0, p1}, Lcom/xingbook/d/a;->e(I)Ljava/io/InputStream;

    move-result-object v2

    const/4 v0, 0x0

    iget-object v3, p0, Lcom/xingbook/park/a/u;->a:Landroid/graphics/BitmapFactory$Options;

    invoke-static {v2, v0, v3}, Landroid/graphics/BitmapFactory;->decodeStream(Ljava/io/InputStream;Landroid/graphics/Rect;Landroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_4

    move-result-object v0

    :goto_0
    if-eqz v2, :cond_0

    :try_start_2
    invoke-virtual {v2}, Ljava/io/InputStream;->close()V
    :try_end_2
    .catch Ljava/io/IOException; {:try_start_2 .. :try_end_2} :catch_3

    :cond_0
    :goto_1
    return-object v0

    :catch_0
    move-exception v0

    move-object v1, v0

    move-object v0, v2

    :goto_2
    :try_start_3
    invoke-virtual {v1}, Ljava/lang/Exception;->printStackTrace()V
    :try_end_3
    .catchall {:try_start_3 .. :try_end_3} :catchall_0

    if-eqz v2, :cond_0

    :try_start_4
    invoke-virtual {v2}, Ljava/io/InputStream;->close()V
    :try_end_4
    .catch Ljava/io/IOException; {:try_start_4 .. :try_end_4} :catch_1

    goto :goto_1

    :catch_1
    move-exception v1

    invoke-virtual {v1}, Ljava/io/IOException;->printStackTrace()V

    goto :goto_1

    :catchall_0
    move-exception v0

    if-eqz v2, :cond_1

    :try_start_5
    invoke-virtual {v2}, Ljava/io/InputStream;->close()V
    :try_end_5
    .catch Ljava/io/IOException; {:try_start_5 .. :try_end_5} :catch_2

    :cond_1
    :goto_3
    throw v0

    :catch_2
    move-exception v1

    invoke-virtual {v1}, Ljava/io/IOException;->printStackTrace()V

    goto :goto_3

    :catch_3
    move-exception v1

    invoke-virtual {v1}, Ljava/io/IOException;->printStackTrace()V

    goto :goto_1

    :catch_4
    move-exception v0

    move-object v4, v0

    move-object v0, v1

    move-object v1, v4

    goto :goto_2

    :cond_2
    move-object v0, v1

    goto :goto_0
.end method


# virtual methods
.method public getCount()I
    .locals 1

    iget-object v0, p0, Lcom/xingbook/park/a/u;->c:[Lcn/a/a/c/a;

    array-length v0, v0

    return v0
.end method

.method public getItem(I)Ljava/lang/Object;
    .locals 1

    iget-object v0, p0, Lcom/xingbook/park/a/u;->c:[Lcn/a/a/c/a;

    aget-object v0, v0, p1

    return-object v0
.end method

.method public getItemId(I)J
    .locals 2

    int-to-long v0, p1

    return-wide v0
.end method

.method public getView(ILandroid/view/View;Landroid/view/ViewGroup;)Landroid/view/View;
    .locals 3

    if-nez p2, :cond_1

    iget-object v0, p0, Lcom/xingbook/park/a/u;->e:Landroid/content/Context;

    const v1, 0x7f030015

    const/4 v2, 0x0

    invoke-static {v0, v1, v2}, Landroid/view/View;->inflate(Landroid/content/Context;ILandroid/view/ViewGroup;)Landroid/view/View;

    move-result-object p2

    new-instance v1, Lcom/xingbook/park/a/v;

    invoke-direct {v1, p0}, Lcom/xingbook/park/a/v;-><init>(Lcom/xingbook/park/a/u;)V

    const v0, 0x7f0a00c6

    invoke-virtual {p2, v0}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/ImageView;

    iput-object v0, v1, Lcom/xingbook/park/a/v;->a:Landroid/widget/ImageView;

    iget-object v0, v1, Lcom/xingbook/park/a/v;->a:Landroid/widget/ImageView;

    invoke-virtual {v0, p0}, Landroid/widget/ImageView;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    iget-object v0, v1, Lcom/xingbook/park/a/v;->a:Landroid/widget/ImageView;

    invoke-static {p1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v2

    invoke-virtual {v0, v2}, Landroid/widget/ImageView;->setTag(Ljava/lang/Object;)V

    invoke-virtual {p2, v1}, Landroid/view/View;->setTag(Ljava/lang/Object;)V

    move-object v0, v1

    :goto_0
    iget-object v1, p0, Lcom/xingbook/park/a/u;->c:[Lcn/a/a/c/a;

    aget-object v1, v1, p1

    invoke-virtual {v1}, Lcn/a/a/c/a;->c()I

    move-result v1

    invoke-direct {p0, v1}, Lcom/xingbook/park/a/u;->a(I)Landroid/graphics/Bitmap;

    move-result-object v1

    if-eqz v1, :cond_0

    iget-object v0, v0, Lcom/xingbook/park/a/v;->a:Landroid/widget/ImageView;

    invoke-virtual {v0, v1}, Landroid/widget/ImageView;->setImageBitmap(Landroid/graphics/Bitmap;)V

    :cond_0
    return-object p2

    :cond_1
    invoke-virtual {p2}, Landroid/view/View;->getTag()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/xingbook/park/a/v;

    goto :goto_0
.end method

.method public onClick(Landroid/view/View;)V
    .locals 3

    iget-object v0, p0, Lcom/xingbook/park/a/u;->f:Lcom/xingbook/c/a;

    const/4 v1, 0x0

    invoke-virtual {v0, v1}, Lcom/xingbook/c/a;->a(I)V

    new-instance v1, Landroid/content/Intent;

    iget-object v0, p0, Lcom/xingbook/park/a/u;->e:Landroid/content/Context;

    const-class v2, Lcom/xingbook/park/activity/ReadingAct;

    invoke-direct {v1, v0, v2}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    const-string v2, "com.xingbook.park.PAGE_ID"

    invoke-virtual {p1}, Landroid/view/View;->getTag()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/lang/Integer;

    invoke-virtual {v1, v2, v0}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/io/Serializable;)Landroid/content/Intent;

    iget-object v0, p0, Lcom/xingbook/park/a/u;->e:Landroid/content/Context;

    check-cast v0, Landroid/app/Activity;

    const/16 v2, 0x64

    invoke-virtual {v0, v1, v2}, Landroid/app/Activity;->startActivityForResult(Landroid/content/Intent;I)V

    iget-object v0, p0, Lcom/xingbook/park/a/u;->e:Landroid/content/Context;

    check-cast v0, Landroid/app/Activity;

    const v1, 0x7f04001c

    const v2, 0x7f040020

    invoke-virtual {v0, v1, v2}, Landroid/app/Activity;->overridePendingTransition(II)V

    return-void
.end method
